
# SDS Tools Related Paths
ADSIncludes = $(VRXSDK)\include


#  App Source Paths
SrcDir = ..\CATM\

ACTIncludes = $(VACT2000)\include
VMACIncludes = $(VVMAC)\include

#  UCL Include Paths
UCLIncludes = $(VUCL)\include
TCPIncludes = $(VTCPIP)\include
TCPVerixIncludes = $(VTCPIP)\Verixinclude

#  Compiler/Linker/Outhdr Output Paths
ObjDir = ..\CATM\adsDebug
OutDir = ..\CATM\adsDebug


# ACT Library Paths
ACTLibraries = $(VACT2000)\output\rv\files\shlib1\debug
ACTLibStatic = $(VACT2000)\output\rv\files\static\debug

# Library Paths
UCLLibraries = $(VUCL)\output\rv\files\static\Debug
TCPLibraries = $(VTCPIP)\output\rv\files\static\Debug

#
# Options for Tools
#

# Compiler Options
Includes = -I$(ADSIncludes) -I$(UCLIncludes) -I$(TCPIncludes) -I$(TCPVerixIncludes) -I$(ACTIncludes) -I$(SrcDir) -I$(VMACIncludes)

# ENABLE THE FOLLOWING LINE IF YOU WANT TO ENABLE LOG_PRINTF MESSAGES IN YOUR APP
#COptions = -D__K2__ -D_DEBUG -DLOGSYS_FLAG -f -s int=2 -s sizeof=2 -O d -r a4 -r a5 -o $(@)
COptions = -DLOGSYS_FLAG

# ENABLE THE FOLLOWING LINE IF YOU WANT TO DISABLE LOG_PRINTF MESSAGES IN YOUR APP
#COptions = -D__K2__ -D_DEBUG -f -s int=2 -s sizeof=2 -O d -r a4 -r a5 -o $(@)

#
# Dependencies
#

AppObjects = \
        $(ObjDir)\CATM.o \
		$(ObjDir)\MENU.o \
		$(ObjDir)\USERIF.o \
		$(ObjDir)\MSG.o \
		$(ObjDir)\POBTRAN.o \
		$(ObjDir)\COMM.o \
		$(ObjDir)\PINPAD.o \
		$(ObjDir)\UCLCODE.o


ACTLibs = \
#$(ACTLibraries)\act.slk \
$(UCLLibraries)\ucl.a \
$(TCPLibraries)\vtcpip.a \
$(VRXSDK)\lib\verix.lib\
#$(ACT2000)\sdsfiles\libc.a\
$(ACTLibStatic)\act2000.a
	
#
#  sample Target Definition
#

pseudoOut : $(OutDir)\CATM.out $(OutDir)\RES\CATM.res
	$(VRXSDK)\bin\vrxhdr -s 70000 -h 55000 $(OutDir)\CATM.out
#	$(VFSDK)\bin\outhdr -t -s 10000 -h 2000 -lact.lib=f:/act.lib $(OutDir)\CATM.out

#For 33xx, use the following lines to sign the out and scf file. 
#    	"$(VSFSTOOL)\filesignature" $(OutDir)\CATM.fst -nogui
  $(VFSDK)\bin\FILESIGN -c $(VFSDK)\CONFIG\K2SIGN.CRT -k $(VFSDK)\CONFIG\K2SIGN.KEY -f $(OutDir)\CATM.OUT -s $(OutDir)\CATM.p7s -L

$(OutDir)\CATM.out : $(AppObjects)
  $(VRXSDK)\bin\vrxcc $(AppObjects) $(ACTLibs) -O$(OutDir)\CATM.out
#  move CATM.out $(OutDir)\CATM.out

#$(OutDir)\CATM.out : $(OutDir)\CATM.odb
#  $(sdsTools)\down -F$(VFSDK)\config\down.opt $(OutDir)\CATM.odb -o $(@)

#$(OutDir)\CATM.odb : $(AppObjects)
#  $(sdsTools)\linker $(linkOptions) $(AppObjects) -y $(ACTLibs) -o $(@)

$(OutDir)\RES\CATM.res : $(SrcDir)\CATM_ADS.rck
  $(VVMAC)\Tools\rck2 -S$(SrcDir)\CATM_ADS -O$(OutDir)\RES\CATM -M
#  move CATM.res $(OutDir)\CATM.res
#  $(VFDEV)\bin\utils\rck2 -S$(SrcDir)\CATM -O$(ObjDir)\CATM -M


######  Compile #######

$(ObjDir)\CATM.o : $(SrcDir)\CATM.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\CATM.c | $(DTKTOOLS)\fmterr.exe
  move CATM.o $(ObjDir)\CATM.o
  
$(ObjDir)\MENU.o : $(SrcDir)\Menu.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\Menu.c | $(DTKTOOLS)\fmterr.exe
  move MENU.o $(ObjDir)\MENU.o

$(ObjDir)\USERIF.o : $(SrcDir)\UserIf.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\UserIf.c | $(DTKTOOLS)\fmterr.exe
  move USERIF.o $(ObjDir)\USERIF.o

$(ObjDir)\MSG.o : $(SrcDir)\Msg.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\Msg.c | $(DTKTOOLS)\fmterr.exe
  move MSG.o $(ObjDir)\MSG.o

$(ObjDir)\POBTRAN.o : $(SrcDir)\PobTran.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\PobTran.c | $(DTKTOOLS)\fmterr.exe
  move POBTRAN.o $(ObjDir)\POBTRAN.o

$(ObjDir)\COMM.o : $(SrcDir)\Comm.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\Comm.c | $(DTKTOOLS)\fmterr.exe
  move COMM.o $(ObjDir)\COMM.o

$(ObjDir)\PINPAD.o : $(SrcDir)\Pinpad.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\Pinpad.c | $(DTKTOOLS)\fmterr.exe
  move PINPAD.o $(ObjDir)\PINPAD.o

$(ObjDir)\UCLCODE.o : $(SrcDir)\uclcode.c 
  $(VRXSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\uclcode.c | $(DTKTOOLS)\fmterr.exe
  move UCLCODE.o $(ObjDir)\UCLCODE.o